{%extends 'template.html'%}

{%block username%}
{{head.username}}
{%endblock%}

{%block content%}
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">{{head.value}}</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="btn-group">
                        <!--<a><button id='bt-add' type="button" class="btn btn-primary">增加</button></a>-->
                        <!--<a><button id='bt-del' data-text="确定删除主机? 0个" type="button" class="btn btn-danger">删除</button></a>-->
                        <a><button id='bt-search' type="button" class="btn btn-success">高级搜索</button></a>
                        <a><button id='bt-reset' type="button" class="btn btn-danger">重置高级搜索</button></a>
                        <a><button id='bt-refresh' type="button" class="btn btn-primary">刷新状态</button></a>
                    </div>
                </div>
                <div class="panel-body">
                    <div id="div-search" class="hide">
                      <table id="high-search" style="width: 67%; margin: 0 auto 2em auto;" border="0" cellpadding="3" cellspacing="0">
                        <thead>
                            <tr>
                                <th>目标</th>
                                <th>内容</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr id="_filter_ctype" data-column="2">
                                <td>类别</td>
                                <td align="center">
                                   <select id="filter_ctype" style="width: 100%">
                                      <option value="100" selected="selected">全部</option>
                                      <option value="0">电子设备</option>
                                      <option value="1">其他电子设备</option>
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_company" data-column="5">
                                <td>公司</td>
                                <td align="center">
                                   <select id="filter_company" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for company in all_company %}
                                        <option value={{company.id}}>{{company.text}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_assets_number" data-column="4">
                                <td>资产编号</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_assets_number" type="text"></td>
                            </tr>
                            <tr id="_filter_name" data-column="5">
                                <td>资产名称</td>
                                <td align="center">
                                   <select id="filter_name" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for name in all_assets_name %}
                                        <option value={{name}}>{{name}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_CPU" data-column="6">
                                <td>CPU</td>
                                <td align="center">
                                   <select id="filter_CPU" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for cpu in all_cpu %}
                                        <option value={{cpu}}>{{cpu}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_board" data-column="6">
                                <td>主板</td>
                                <td align="center">
                                   <select id="filter_board" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for board in all_board %}
                                        <option value={{board}}>{{board}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_ssd" data-column="6">
                                <td>固态硬盘</td>
                                <td align="center">
                                   <select id="filter_ssd" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for ssd in all_ssd %}
                                        <option value={{ssd}}>{{ssd}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_disk" data-column="6">
                                <td>机械硬盘</td>
                                <td align="center">
                                   <select id="filter_disk" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for disk in all_disk %}
                                        <option value={{disk}}>{{disk}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_mem" data-column="6">
                                <td>内存</td>
                                <td align="center">
                                   <select id="filter_mem" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for mem in all_mem %}
                                        <option value={{mem}}>{{mem}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_graphics" data-column="6">
                                <td>显卡</td>
                                <td align="center">
                                   <select id="filter_graphics" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for graphics in all_graphics %}
                                        <option value={{graphics}}>{{graphics}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_brand" data-column="6">
                                <td>品牌</td>
                                <td align="center">
                                   <select id="filter_brand" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for brand in all_brand %}
                                        <option value={{brand}}>{{brand}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_specification" data-column="6">
                                <td>规格</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_specification" type="text"></td>
                            </tr>
                            <tr id="_filter_using_department" data-column="6">
                                <td>使用部门</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_using_department" type="text"></td>
                            </tr>
                            <tr id="_filter_user" data-column="9">
                                <td>领用人</td>
                                <td align="center"><input style="width:100%" class="column_filter" id="filter_user" type="text"></td>
                            </tr>
                            <tr id="_filter_status" data-column="2">
                                <td>状态</td>
                                <td align="center">
                                   <select id="filter_status" style="width: 100%">
                                      <option value="100" selected="selected">全部</option>
                                      <option value="0">库存</option>
                                      <option value="1">领用</option>
                                      <option value="2">外借</option>
                                      <option value="3">回收</option>
                                      <option value="4">损毁</option>
                                      <option value="5">清理</option>
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_pos" data-column="2">
                                <td>位置</td>
                                <td align="center">
                                   <select id="filter_pos" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                    </select>
                                </td>
                            </tr>
                            <tr id="_filter_pos" data-column="2">
                                <td>供应商</td>
                                <td align="center">
                                   <select id="filter_supplier" class="filter_select2" style="width: 100%">
                                      <option value="0" selected="selected">全部</option>
                                      {% for supplier in all_supplier %}
                                        <option value={{supplier.id}}>{{supplier.name}}</option>
                                      {% endfor %}
                                    </select>
                                </td>
                            </tr>
                        </tbody>
                      </table>
                    </div>
                      <table id="mytable" class="display" width="100%" cellspacing="0">
                          <thead>
                              <tr>
                                  <th>id</th>
                                  <th>项目</th>
                                  <th>地区</th>
                                  <th>标题</th>
                                  <th>优先级</th>
                                  <th>状态</th>
                                  <th>操作</th>
                              </tr>
                          </thead>
                      </table>
                </div>
            </div>
        </div>
        <!-- Modal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">运维管理机</h4>
              </div>
              <div class="modal-body">
                <div class="alert alert-danger alert-dismissable" id='modal-notify'>
                  <button type="button" class="close" id="bt-modal-notify">&times;</button>
                  <label id='lb-msg'></label>
                </div>
                <form class="form-horizontal" role="form">
                  <div class="form-group" id='show_id'>
                      <label class="col-sm-3 control-label">id</label>
                        <input type="text" class="form-control " placeholder="id" id="id">
                      <div class="col-sm-8">
                        <input type="text" class="form-control ">
                      </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-3 control-label">项目</label>
                    <div class="col-sm-8">
                        <div class="form-group row">
                            <div class="col-sm-8">
                                <input type="text" class="form-control "  id="project" style="width: 160%" readonly="readonly">
                            </div>
                        </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-3 control-label">地区</label>
                    <div class="col-sm-8">
                        <div class="form-group row">
                            <div class="col-sm-8">
                                <input type="text" class="form-control "  id="area_name" style="width: 160%" readonly="readonly">
                            </div>
                        </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-3 control-label">标题</label>
                    <div class="col-sm-8">
                        <div class="form-group row">
                            <div class="col-sm-8">
                                <input type="text" class="form-control "  id="title" style="width: 160%" readonly="readonly">
                            </div>
                        </div>
                    </div>
                  </div>
                  <div class="form-group">
                      <label class="col-sm-3 control-label ">优先级</label>
                        <div class="col-sm-8">
                          <select id="priority" style="width: 100%">
                            {% for k, v in data.priority.items %}
                                {% if k == '0' %}
                                    <option selected="selected" value={{k}}>{{v}}</option>
                                {% else %}
                                    <option value={{k}}>{{v}}</option>
                                {% endif %}
                            {% endfor %}
                          </select>
                        </div>
                  </div>
                  <div class="form-group">
                      <label class="col-sm-3 control-label ">状态</label>
                        <div class="col-sm-8">
                          <select id="status" style="width: 100%">
                            {% for k, v in data.status.items %}
                                {% if k == '0' %}
                                    <option selected="selected" disabled="disabled" value={{k}}>{{v}}</option>
                                {% else %}
                                    <option value={{k}}>{{v}}</option>
                                {% endif %}
                            {% endfor %}
                          </select>
                        </div>
                  </div>
                </form>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button id='bt-save' type="button" class="btn btn-primary">保存</button>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>
</div>
{%endblock%}
{%block bodyjs%}
    <script src="/static/js/jquery.dataTables.js" ></script>
    {{ django_context_varable }}
    {% verbatim %}
    <script id="tpl" type="text/x-handlebars-template">
          {{#each func}}
          <button type="button" class="btn btn-{{this.type}} btn-sm" onclick="{{this.fn}}">{{this.name}}</button>
          {{/each}}
    </script>
    {% endverbatim %}
    <script src="/static/js/handlebars-v3.0.1.js"></script>
    <script src="/static/js/hot_client_list.js"></script>
{%endblock%}
{%block css%}
<link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
<link href="/static/css/mycss.css" rel="stylesheet" type="text/css">
{%endblock%}
